package com.bw.fun;

import com.bw.utils.IkUtil;
import org.apache.flink.table.annotation.DataTypeHint;
import org.apache.flink.table.annotation.FunctionHint;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

import java.util.List;
import java.util.Set;

//我爱我的祖国
//我
//我爱
//我的
//祖国
@FunctionHint(output = @DataTypeHint("ROW<keyword STRING>"))
public class XT3UDTF extends TableFunction<Row> {
    public void eval(String str) {
        Set<String> strings = IkUtil.split(str);
        for (String s : strings) {
            collect(Row.of(s));
        }
    }
}